/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package com.plian.system.service.pf;

import com.plian.Tools.pagedata.PageData;
import com.plian.system.dto.pf.BaseGrantSalaryDTO;
import com.plian.system.entity.pf.BaseGrantSalary;
import com.plian.system.entity.pm.propertyinformation.PropertyTime;
import com.plian.system.entity.sys.Message;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.model.R;
import com.plian.system.mybatis.base.BaseService;
import com.plian.system.mybatis.support.Query;
import com.plian.system.vo.pf.BaseGrantSalaryVO;
import com.plian.system.vo.report.ReportReturnVO;

import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;

/**
 * 服务类
 *
 * @author
 * @since 2019-09-27
 */
public interface IBaseGrantSalaryService extends BaseService<BaseGrantSalary> {


    /**
     * 每月只能填写一次
     * @param baseGrantSalary
     * @return
     */
    String checkMonth(BaseGrantSalary baseGrantSalary);

    /**
     * 保存 包含子表
     * @param baseGrantSalary
     * @return
     */
    boolean submit(BaseGrantSalary baseGrantSalary);

    /**
     * 获取detail obj对象
     * @param grantSalaryVO
     * @return
     */
    R<BaseGrantSalaryVO> getDetailObj(BaseGrantSalaryVO grantSalaryVO);


    /**
     * 获取上月已填报数据
     * @param baseGrantSalary
     * @return
     */
    R<BaseGrantSalaryVO> getLastMonthObj(BaseGrantSalary baseGrantSalary);

    /**
     * 职工工资发放表-统计用(   年度)
     * @param baseGrantSalaryDTO
     * @return
     */
    ReportReturnVO yearStatistics(BaseGrantSalaryDTO baseGrantSalaryDTO);

    /**
     * 获取tree列表页
     * @param query
     * @return
     */
    ListResult<PageData> treeList(Query query);

    /**
     * 获取本级和下级汇总数据
     * @param baseGrantSalary
     * @return
     */
    ObjResult getSummaryObj(BaseGrantSalary baseGrantSalary);

    /**
     * 填报树
     * @param baseGrantSalary
     * @return
     */
    ObjResult tree(BaseGrantSalary baseGrantSalary);

    /**
     * 工资填报树 新增
     * @param baseGrantSalary
     * @return
     */
    R addTree(BaseGrantSalary baseGrantSalary);

    /**
     * 获取下级已填报数据
     * @param baseGrantSalary
     * @return
     */
    ObjResult childList(BaseGrantSalary baseGrantSalary);

    /**
     * 根据主表id 获取合计数据
     * @param baseGrantSalary
     * @return
     */
    R<BaseGrantSalary> childSummary(BaseGrantSalary baseGrantSalary);

    /**
     * 合计数据来源
     * @param baseGrantSalaryDTO
     * @return
     */
    ObjResult summaryDetail(BaseGrantSalaryDTO baseGrantSalaryDTO);

    /**
     * 填报树
     * @param baseGrantSalary
     * @return
     */
    R initAdd(BaseGrantSalary baseGrantSalary);

    void exportExcel(PageData pd, HttpServletResponse response, OutputStream os) ;

    List<PageData> findGrantSalaryListByCreate(PropertyTime propertyTime) ;

    List<PageData> findGrantSalaryListByUpdate(PropertyTime propertyTime) ;

//    /** TODO DEL
//     * 获取工资发放预警统计列表
//     * @param baseGrantSalaryDTO
//     * @return
//     */
//    List<SalaryWarningVO> getSalaryWarning(BaseGrantSalaryDTO baseGrantSalaryDTO);

    /**
     * 获取工资发放预警消息
     * @return
     */
    List<Message> getWarningMessage();

}
